package com.walter.common.autoconfigure;

import com.walter.common.interceptors.TraceIdFilter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * @author Walter
 * @date 2025/2/7 下午12:53
 **/
@Slf4j
public class TraceIdFilterAutoConfiguration {
    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(new TraceIdFilter());
        bean.addUrlPatterns("/*");
        log.info("TraceIdFilterAutoConfiguration initialized");
        return bean;
    }

}
